<!--
  Copyright 2013-2019 the original author or authors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<div ng-include src="'template/gt-loading-overlay.html'"></div>
<div ng-include src="'template/gt-http-error-overlay.html'"></div>
<div ng-if="data.agentNotConnected" class="alert alert-danger" role="alert">
  The agent is not currently connected. The values below were reported at last JVM start.
</div>
<div ng-if="layout.offlineViewer" class="alert alert-warning">
  The values below were reported at last JVM start.
</div>
<fieldset class="gt-fieldset-environment">
  <legend class="gt-legend">
    Host
  </legend>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Host name
    </div>
    <div class="col-md-9">
      {{data.host.hostname}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Available processors
    </div>
    <div class="col-md-9">
      {{data.host.availableProcessors}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Total physical memory
    </div>
    <div class="col-md-9">
      {{data.host.totalPhysicalMemoryBytes | gtBytes}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      OS name
    </div>
    <div class="col-md-9">
      {{data.host.osName}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      OS version
    </div>
    <div class="col-md-9">
      {{data.host.osVersion}}
    </div>
  </div>
  <div class="row gt-jvm-general-row" ng-if="supportsHostCurrentTime()">
    <div class="col-md-3 text-md-right font-weight-600">
      Current time
    </div>
    <div class="col-md-9" ng-if="data.agentNotConnected || layout.offlineViewer">
      -
    </div>
    <div class="col-md-9" ng-if="!data.agentNotConnected && !layout.offlineViewer">
      {{data.host.currentTime | date:'medium'}}
    </div>
  </div>
</fieldset>
<fieldset class="gt-fieldset-environment">
  <legend class="gt-legend">
    Process
  </legend>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Process ID
    </div>
    <div class="col-md-9">
      {{data.process.processId === undefined ? 'N/A' : data.process.processId}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Start time
    </div>
    <div class="col-md-9">
      {{data.process.startTime | date:'medium'}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Uptime
    </div>
    <div class="col-md-9" ng-if="data.agentNotConnected || layout.offlineViewer">
      -
    </div>
    <div class="col-md-9" ng-if="!data.agentNotConnected && !layout.offlineViewer">
      {{uptime | gtDuration}}
    </div>
  </div>
</fieldset>
<fieldset class="gt-fieldset-environment">
  <legend class="gt-legend">
    Java
  </legend>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Version
    </div>
    <div class="col-md-9">
      {{data.java.version}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      VM
    </div>
    <div class="col-md-9">
      {{data.java.vm}}
    </div>
  </div>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Args
    </div>
    <div class="col-md-9">
      <!-- track by $index is needed since duplicates are possible in this list -->
      <div class="gt-jvm-argument gt-break-word"
           ng-repeat="arg in data.java.args track by $index">
        <span style="white-space: nowrap;">{{argFirstPart(arg)}}</span>{{argSecondPart(arg)}}
      </div>
    </div>
  </div>
</fieldset>
<fieldset class="gt-fieldset-environment">
  <legend class="gt-legend">
    Glowroot agent
  </legend>
  <div class="row gt-jvm-general-row">
    <div class="col-md-3 text-md-right font-weight-600">
      Version
    </div>
    <div class="col-md-9">
      {{data.java.glowrootAgentVersion}}
    </div>
  </div>
</fieldset>
